import type { CustomRequestConfig } from "./types";

// 默认配置
export const DEFAULT_CONFIG: CustomRequestConfig = {
  baseURL: import.meta.env.VITE_BASE_URL || "/api",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
    "X-Requested-With": "XMLHttpRequest"
  }
};

// 合并配置
export const getConfig = (
  customConfig: CustomRequestConfig = {}
): CustomRequestConfig => {
  return {
    ...DEFAULT_CONFIG,
    ...customConfig
  };
};
